Skip to content

.438081291297676:be4ed675800a877ee7d371ea48991a9f_69ef6d0fdf20d71b25c740e2.69ef6d2cdf20d71b25c7411d.69ef6d2b0d279a6ad9dc4247:Trae CN.T(2026/4/27 22:05:40)#29

Open
baiding72 wants to merge 2 commits into
emredkyc:mainfrom
baiding72:trae1
Open

.438081291297676:be4ed675800a877ee7d371ea48991a9f_69ef6d0fdf20d71b25c740e2.69ef6d2cdf20d71b25c7411d.69ef6d2b0d279a6ad9dc4247:Trae CN.T(2026/4/27 22:05:40)#29
baiding72 wants to merge 2 commits into
emredkyc:mainfrom
baiding72:trae1

Conversation

@baiding72
Copy link
Copy Markdown

实现任务列表的筛选功能,包括按负责人、阶段和截止日期范围筛选
添加 TaskFilter 组件处理筛选逻辑
更新任务列表显示逻辑以支持筛选结果

实现任务列表的筛选功能,包括按负责人、阶段和截止日期范围筛选
添加 TaskFilter 组件处理筛选逻辑
更新任务列表显示逻辑以支持筛选结果
Copilot AI review requested due to automatic review settings April 27, 2026 14:36
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

@baiding72 is attempting to deploy a commit to the emredkyc's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 为任务看板列表增加筛选能力(按负责人、阶段、截止日期范围),通过新增筛选组件并在列表页对任务数据进行前端过滤,以支持筛选后的展示。

Changes:

  • 新增 TaskFilter 组件,提供负责人/阶段/截止日期范围的筛选 UI 与状态管理
  • 在任务列表页引入筛选状态,并基于筛选条件对任务集合进行过滤
  • 更新任务分组逻辑,使列中的任务来自筛选后的结果

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/pages/tasks/list.tsx 增加筛选状态与 filteredTasks,并用筛选结果生成看板列数据
src/components/tasks/filter/index.tsx 新增筛选组件(负责人、阶段、多选与日期范围),提供清空筛选入口

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

placeholder="选择负责人"
style={{ width: '100%' }}
value={filters.userIds}
onChange={handleUserChange}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

负责人 <Select> does not spread usersSelectProps, so you lose useSelect-provided props like loading state, search handlers, and any configured filtering/pagination behavior. Consider spreading {...usersSelectProps} (and overriding options with your custom userOptions), to keep behavior consistent with other useSelect usages.

Suggested change
onChange={handleUserChange}
onChange={handleUserChange}
{...usersSelectProps}

Copilot uses AI. Check for mistakes.
Comment thread src/pages/tasks/list.tsx
Comment on lines +98 to 103
if (!filteredTasks.length || !stages?.data) {
return {
unassignedStage: [],
stages: []
}
}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taskStages memo returns { unassignedStage, stages: [] } in the empty state but the non-empty state returns { unassignedStage, columns: grouped }. Downstream JSX reads taskStages.columns, so when filteredTasks is empty (e.g. filters exclude all tasks) stage columns disappear entirely. Return a consistent shape (use columns in both branches), and avoid early-returning on !filteredTasks.length so the board can still render all stages with zero tasks.

Copilot uses AI. Check for mistakes.
Comment thread src/components/tasks/filter/index.tsx Outdated
Comment on lines +136 to +138
value={filters.stageIds}
onChange={handleStageChange}
{...stagesSelectProps}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the 阶段 <Select>, {...stagesSelectProps} is spread after value/onChange, so any value/onChange from stagesSelectProps will override your controlled state and handleStageChange (this pattern typically breaks filter updates). Spread stagesSelectProps first and then override with value={filters.stageIds} / onChange={handleStageChange}. Also consider adding an explicit "未分配"/"Unassigned" option (value "unassigned") if you want users to be able to filter the unassigned column.

Suggested change
value={filters.stageIds}
onChange={handleStageChange}
{...stagesSelectProps}
{...stagesSelectProps}
value={filters.stageIds}
onChange={handleStageChange}

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +10
import dayjs, { Dayjs } from 'dayjs'
import { RangePickerProps } from 'antd/es/date-picker'
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dayjs is imported but never used in this component (only Dayjs is used as a type). Remove the unused default import to avoid lint/TS warnings (or switch to import type { Dayjs } from 'dayjs' if your tooling supports it).

Suggested change
import dayjs, { Dayjs } from 'dayjs'
import { RangePickerProps } from 'antd/es/date-picker'
import type { Dayjs } from 'dayjs'
import type { RangePickerProps } from 'antd/es/date-picker'

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +52
return usersSelectProps.options.map((user) => ({
value: user.value,
label: (
<SelectOptionWithAvatar
name={user.label as string}
avatarUrl={(user as any).avatarUrl}
/>
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userOptions builds avatarUrl via (user as any).avatarUrl, but useSelect().selectProps.options typically only contains { value, label }, so avatars will likely always be undefined and the any cast hides it. Prefer mapping from the useSelect queryResult.data?.data nodes (which include avatarUrl in USERS_SELECT_QUERY) to build options with strongly typed fields, similar to the pattern used elsewhere when rendering SelectOptionWithAvatar.

Copilot uses AI. Check for mistakes.
refactor(components/tasks/filter): 使用@refinedev/antd替换@refinedev/core
fix(components/tasks/filter): 修复用户选项类型定义和空值处理
build: 生成dist目录下的静态资源文件
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants